import core from 'gapi/core'

class teamApi extends core{
    /**
     * 加密
     * @method dekEncrypt
     * @public
     * @param {String} info 需要加密的字段
     * @param {Function} callBack 回调函数
     * @return {Object}
     * {data:信息}
     * @example
     *        clientInfo.dekEncrypt('123456',function(data){
     *          console.log(data);//返回字符串
     *      });
     * @since 1.0.0
     */
    addFromContacts (callBack){
        this.sendData({
            method: "addFromContacts",
            param: {
            },
            callBack: callBack
        });
    }

    /*创建团队返回团队列表更新*/
    updateTeam (team_id,callBack){
        this.sendData({
            method: "updateTeam",
            param: {
                'team_id':team_id
            },
            callBack: callBack
        });
    }

    /*添加成员返回成员列表更新*/
    updateMember (callBack){
        this.sendData({
            method: "updateMember",
            param: {
            },
            callBack: callBack
        });
    }

    //隐藏底部tabBar
    //type  0: 隐藏  1: 显示
    updateBottomStatus (type){
        this.sendData({
            method: "updateBottomStatus",
            param: {
                type: type
            }
        });
    }

    setIsLoad(isload){
        this.sendData({
            method: "setIsLoad",
            param: {
                isload: isload
            }
        });
    }

    //弹出带输入框的提示框
    showAlertInputView(title, okBtn, cancelBtn, callBack){
        this.sendData({
            method: 'showAlertInputView',
            param: {
                title: title,
                okBtn: okBtn,
                cancelBtn: cancelBtn
            },
            callBack: callBack
        })
    }
    /**
     * 调起评价弹层
     * @param: {JSON callBack}: return search list data
     */
    showEvaluation(data, callBack){
        this.sendData({
            method: "showEvaluation",
            param: {
                data: data
            },
            callBack: callBack
        });
    }
        /**
     * 调起支付弹层
     * @param: {JSON callBack}: return search list data
     */
    showPayDialog(money, callBack){
        this.sendData({
            method: "showPayDialog",
            param: {
                money: money
            },
            callBack: callBack
        });
    }
         /**
     * 调起支付失败弹层
     * @param: {JSON callBack}: return search list data
     */
    showPayFaildDialog(error_msg){
        this.sendData({
            method: "showPayFaildDialog",
            param: {
                error_msg: error_msg
            }
        });
    }
    /**
     * 调起反馈弹层
     * @param: {JSON callBack}: return search list data
     */
    showFeedback(data, callBack){
        this.sendData({
            method: "showFeedback",
            param: {
                data: data
            },
            callBack: callBack
        });
    }
    //合同签署验证码弹层
    showCodeDialog(teamId, projectId, type, callBack){
        this.sendData({
            method: 'showCodeDialog',
            param: {
                teamId: teamId,
                projectId: projectId,
                type: type,
                "data": "showCodeDialog"
            },
            callBack: callBack
        });
    }
}

export default new teamApi({
    // api的名字，可为任意名称
    name: 'teamApi api',
    // 作者
    author: 'huochunyang1@doumi.com',
    // 版本
    version: '2.0',
    // 默认，不用改动
    jsbc: jsBridgeClient,
    // nativeCls 一定要和客户端的同学对应
    nativeCls: 'teamApi'
})